#include <stdio.h>
#include "static-linked-list.h"

int PrintList(StcLiNode *L){
    unsigned int current = L[MAXSIZE-1].cur;
    while (current != 0){
        printf("%d ",L[current].data);
        current = L[current].cur;
    }
    putchar('\n');
    return(0);
}


int myint;
int main(){
    PrintList(StaticLinkedList);
    InitList(StaticLinkedList);
    ListInsert(StaticLinkedList,1,1);
    ListInsert(StaticLinkedList,2,2);
    ListInsert(StaticLinkedList,3,3);
    ListInsert(StaticLinkedList,4,4);
    ListInsert(StaticLinkedList,5,5);
    PrintList(StaticLinkedList);
    ListDelete(StaticLinkedList,2,&myint);
    printf("%d is deleted\n",myint);
    PrintList(StaticLinkedList);
    ListDelete(StaticLinkedList,1,&myint);
    printf("%d is deleted\n",myint);
    PrintList(StaticLinkedList);
    printf("%d is at %d\n",7,LocateElem(StaticLinkedList,7));
    printf("%d is at %d\n",4,LocateElem(StaticLinkedList,4));
    return(0);
}

